<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2019/10/17
  Time: 16:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page isELIgnored="false" contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <title>花卉信息管理系统首页</title>
    <style type="text/css">
        table {
            margin: 0 auto;
            width: 60%;
        }

        table h1 {
            text-align: center;
        }

        table p {
            text-align: right;
        }
    </style>
</head>
<body>


<%--如果指定区间内没有list，要向后台发送请求--%>
<c:if test="${empty list}">
    <c:redirect url="FlowerServlet?type=getAll"></c:redirect>
</c:if>

<table border="1px">
    <tr>
        <td colspan="6">
            <h1>花卉信息列表</h1>
        </td>
    </tr>
    <tr>
        <td colspan="6">
            <p><a href="add.jsp">增加花卉信息</a></p>
        </td>
    </tr>
    <tr>
        <th>花卉编号</th>
        <th>花卉名称</th>
        <th>花卉别名</th>
        <th>花卉科属</th>
        <th>价格（元/支）</th>
        <th>原产地</th>
    </tr>

    <c:forEach items="${list}" var="f">
        <tr>
            <th>${f.id}</th>
            <th>${f.name}</th>
            <th>${f.anothername}</th>
            <th>${f.property}</th>
            <th>${f.price}</th>
            <th>${f.production}</th>
        </tr>
    </c:forEach>


</table>

</body>
</html>
